Food
Food is a type of item available in Minecraft. As the name would imply, food is eaten to replenish Hunger, which is in turn used to regenerate health. With Custom Stuff, you can input your favorite foods into Minecraft, giving you more variety in the sustenance available to you. Adding new food to the game is mostly a matter of aesthetics, although you can create foods that are either easier or harder to obtain than the defaults making them effectively functional or interesting. Even if you just want to make foods that you like there are many, many item IDs available for use so adding a lot of fun items like food just to flesh out the feeling of your minecraft worlds to your own personal tastes (no pun intended) can hardly be considered wasteful. In Custom Stuff 2, Food is an otherwise ordinary item that has properties such as alwaysEdible set to true. Typically the "hunger" and "saturation" attributes are also set to 1 or more, though this isn't necessary is you're using the food for a seperate function such as a potion effect. In these cases, the alwaysEdible attribute is set to true; something that is not the case for a normal food item like bread. Food Example (CS2 0.10.2 and above) mod.js config.addItemIdProperty("appleSauceID", 5011); mod.addAlias(260, "apple"); mod.addAlias(281, "bowl"); mod.addAlias(config.getItemId("appleSauceID"), "appleSauce"); mod.addItem("appleSauce.js", "food"); mod.addRecipe("appleSauce 1", 1, 2, "apple", "bowl"); items/appleSauce.js id = config.getItemId("appleSauceID"); name = "appleSauce"; maxStack = 16; full3d = false; creativeTab = "food"; displayName0 = "Apple Sauce"; textureFile0 = "appleSauce.png"; addToCreative0 = true; alwaysEdible0 = false; hunger0 = 3; saturation0 = 2; onEaten0 = "player.add(281, 1, 0);"; //returns a bowl Potion Example (CS2 0.10.2 and above) mod.js config.addItemIdProperty("instantColaID"); mod.addItem("drink.js", "food"); items/drink.js id = config.getItemId("instaColaID"); name = "InstaCola"; displayName0 = "InstaCola"; textureFile0 = "instaCola.png"; maxStack = 10; full3d = false; addToCreative0 = true; creativeTab = "food"; alwaysEdible0 = true; potion0 = "regeneration"; potionDuration0 = 60; potionAmplifier0 = 255; potionProbability0 = 1.0; usingAction0 = "drink"; leaveContainerItem = true; containerItem = config.getItemId("emptyCanID") + " 1"; onEaten0 = "player.addPotionEffect('moveSpeed',1800,5);\ player.addPotionEffect('jump',1800,5);\ player.add(config.getItemId('emptyCanID'), 1, 0);"; Food Item Attributes Required Attributes * displayName * id * name Optional Attributes * addToCreative * alwaysEdible * containerItem * creativeTab * damage * displayName * effectiveBlocks * efficiency * enchantability * full3d * harvestLevel * hunger * information * leaveContainerItem * maxDamage * maxStack * maxUsingDuration * potion * potionAmplifier * potionDuration * potionProbability * repairable * saturation * textureFile * toolClass * usingAction textureFile and textureIndex In CS2 versions for 1.4.7 and below, CS2 0.9.9 or below, textureFile was used to specify the texture sheet and textureIndex was used for identifying the specific icon within the texture sheet. If using CS2 0.9.9 or lower, make sure to use both of these attributes. Example Food Item name="Pumpkin Cookie"; id=700; type="food"; iconfile="PSJust4Fun.png"; iconindex=0; maxstack=64; saturation=0.3; //How 'filling' the food item is. healamount=2; //How many units of food is healed. 1 = 1/2 'drumstick'. Food Item Attributes Below is a table of attributes available to food-type items, including information on notable attributes. Required Attributes * name * id * type * iconfile * iconindex * healamount * saturation Optional Attributes * maxstack type This must be set to 'food' for the item to be edible by the player. healamount This is an integer value. Each point heals half a 'drumstick' on the hunger bar. You can set this value as high as you like. saturation The saturation of the food represents how 'filling' the item is. Valid values for saturation are decimal numbers (0.1, 0.2, etc.) greater than zero. The higher the value the longer it takes to get hungry. CS 1 Bugs * In the current version (2.3.4) the particles that come from a food item when eaten are drawn from /gui/items.png regardless of which iconfile is chosen. The iconindex will determine which sprite is used, however. This may be a bug in Forge, and not a problem with Custom Stuff, as evidenced by how other Forge mods also seem to exhibit this problem. * When in third person view, food items will seem to be very large because the game renders them with the same size and orientation of tools. This bug is still present in CS 2.3.4. Category:Item Types Category:Examples Category:Examples (CS1) Category:Examples (CS2) Category:Custom Stuff 2